#include <bits/stdc++.h>
using namespace std;
const int N = 20, M = 3010;
typedef long long ll;
ll v[N], f[M];
int n, m;
int main() {
  cin >> n >> m;
  f[0] = 1;
  for (int i = 0; i < n; ++i) cin >> v[i];
  for (int i = 0; i < n; ++i) {
    for (int j = v[i]; j <= m; ++j) {
      f[j] += f[j - v[i]];
    }
  }
  cout << f[m] << endl;
}
